﻿using System.Windows.Controls;
using System.Xml.Linq;
using System.Windows.Data;
using Acando.Dynamics.CRM.Silverlight.Library.Converter;
using Acando.Dynamics.CRM.Silverlight.Library.Controls;
using Microsoft.Windows.Controls;
using Acando.Dynamics.CRM.Silverlight.Library.Interfaces;

namespace Acando.Dynamics.CRM.Silverlight.Library.Controls.FieldControls
{
    public partial class CrmMoneyControl : BaseValueControl
    {
        public CrmMoneyControl(IRecordControl recordControl, string controlType, string fieldName)
            : base(recordControl, controlType, fieldName)
        {
            InitializeComponent();
            this.numValue.SetBinding(NumericUpDown.ValueProperty, base.GetBinding(recordControl,controlType,fieldName));
            this.numValue.IsEnabled = !recordControl.IsReadOnly;
            this.lblCurrency.SetBinding(TextBlock.TextProperty, this.GetBinding(recordControl, "string", "transactioncurrencyid"));
        }
    }
}
